package com.cwj.we.http;

import com.cwj.we.bean.BiZhiBean;
import com.cwj.we.bean.LatestBean;
import com.cwj.we.bean.MsgBean;
import com.cwj.we.bean.VerticalBiZhi;
import com.cwj.we.bean.WallpaperBiZhiBean;
import com.cwj.we.bean.WeatherBean;
import com.tencent.mmkv.MMKV;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;

public class API {

    public static final String BASE_URL_UPDATA = "http://api.bq04.com/";//检查更新
    public static final String BASE_URL_Qingyunke = "http://api.qingyunke.com/";//聊天机器人
    public static final MMKV kv = MMKV.defaultMMKV();
    public static final String tianqi = "https://wis.qq.com/weather/";//天气
    public static final String bizhi = "https://service.picasso.adesk.com/";//壁纸

    public interface Api {
        //检测版本更新
        @GET("apps/latest/{id}")
        Observable<LatestBean> latest(@Path("id") String id, @Query("api_token") String api_token);

        //智能机器人
        @GET(BASE_URL_Qingyunke + "api.php?key=free&appid=0")
        Observable<MsgBean> msg(@Query("msg") String msg);

        //腾讯天气
        @GET(tianqi + "common?source=xw&weather_type=forecast_24h|tips")
        Observable<WeatherBean> weather(@Query("province") String province, @Query("city") String city,
                                        @Query("county") String county);

        //获取壁纸分类
        @GET(bizhi + "v1/vertical/category?adult=false&first=1")
        Observable<VerticalBiZhi> getVertical();

        //获取最新壁纸
        @GET(bizhi + "v1/vertical/category/{id}/vertical?adult=false&first=1&order=new")
        Observable<BiZhiBean> getNewBizhi(@Path("id") String id, @Query("limit") Integer limit,
                                          @Query("skip") Integer skip);

        //获取热门壁纸
        @GET(bizhi + "v1/vertical/category/{id}/vertical?adult=false&first=1&order=hot")
        Observable<BiZhiBean> getHotBizhi(@Path("id") String id, @Query("limit") Integer limit,
                                          @Query("skip") Integer skip);

        //获取电脑壁纸
        @GET(bizhi + "v1/wallpaper/category/{id}/wallpaper?adult=false&first=1&order=hot")
        Observable<WallpaperBiZhiBean> getWallpaperBizhi(@Path("id") String id, @Query("limit") Integer limit,
                                                         @Query("skip") Integer skip);
    }
}
